The TCall Structure
You use theTCall
structure to specify the options and data associated with establishing a connection. You pass a pointer to this structure as a parameter to theOTConnect
function (page 3-121), theOTRcvConnect
function (page 3-123), theOTListen
function (page 3-125), and theOTAccept
function (page 3-127).The
TCall
structure is defined by theTCall
data type.
struct TCall { TNetbuf addr; TNetbuf opt; TNetbuf udata; OTSequence sequence; }; typedef struct TCall TCall;
Field Description
addr
- A
TNetbuf
structure that specifies the location and size of a buffer containing an address. If you are using theTCall
structure to send information, you must allocate a buffer and initialize it to contain the address, you must set theaddr.buf
field to point to the buffer, and you must set theaddr.len
field to the size of the address. If you are using theTCall
structure to receive information, you must allocate a buffer into which the function can place the address when it returns, you must set theaddr.buf
field to point to this buffer, and you must set theaddr.maxlen
field to the maximum size of the address.- In the
sndCall
parameter to theOTConnect
function, you must use this field to specify information about the address of the remote peer.- In the
rcvCall
parameter to theOTConnect
function, on return, this field contains information about the address to which you are actually connected.- In the
call
parameter to theOTRcvConnect
function, on return, this field contains information about the address to which you are actually connected.- In the
call
parameter to theOTListen
function, on return, this field contains information about the address of the peer that requested the connection. The function returns the address in a format that you can use in future calls to theOTConnect
function (page 3-121), theOTSndDisconnect
function (page 3-149), theOTSndOrderlyDisconnect
function (page 3-153), or theOTAccept
function (page 3-127).- In the
call
parameter to theOTAccept
function, you can use this field to specify information about the address of the peer that requested the connection. If you do not want to specify a value, set theaddr.len
field to 0.- In the
call
parameter to theOTSndDisconnect
function, this field is reserved.opt
- A
TNetbuf
structure that specifies the location and size of a buffer containing option information. If you are using theTCall
structure to send information, you must allocate a buffer and initialize it to contain the option information, you must set theopt.buf
field to point to the buffer, and you must set theopt.len
field to the size of the option data. Set theopt.len
field to 0 if you don't want to specify any options. If you are using theTCall
structure to receive information, you must allocate a buffer into which the function can place option data when it returns, you must set theopt.buf
field to point to this buffer, and you must set theopt.maxlen
field to the maximum size of the option information.- In the
sndCall
parameter to theOTConnect
function, you can use this field to specify the options you want to negotiate.- In the
rcvCall
parameter to theOTConnect
function, on return, this field specifies the options that have been negotiated for this connection.- In the
call
parameter to theOTRcvConnect
function, on return, this field specifies the options that have been negotiated for this connection.- In the
call
parameter to theOTListen
function, on return, this field specifies the options that the peer has requested for this connection.- In the
call
parameter to theOTAccept
function, you can use this field to specify the options that you want to use for the connection. Specifying 0 for theopt.len
field means that you accept the connection unconditionally.- In the
call
parameter to theOTSndDisconnect
function, this field is reserved.udata
- A
TNetbuf
structure that specifies the location and size of a buffer containing data associated with a connection or disconnection request. Not all endpoints support the sending of data while establishing or tearing down a connection. Examine theconnect
ordiscon
field of theTEndpointInfo
structure for the endpoint to determine if the endpoint supports the sending of data and to find out the maximum size of the data you can send.- If you are using the
TCall
structure to send data, you must allocate a buffer and initialize it to contain the data, you must set theudata.buf
field to point to the buffer, and you must set theudata.len
field to the size of the data. If you are using theTCall
structure to receive information, you must allocate a buffer into which the function can place the data when it returns, you must set theudata.buf
field to point to this buffer, and you must set theudata.maxlen
field to the maximum size of the data.- In the
sndCall
parameter to theOTConnect
function, you can use this field to specify the data associated with the connection request.- In the
rcvCall
parameter to theOTConnect
function, on return, this field specifies data that has been sent by the peer accepting the connection.- In the
call
parameter to theOTListen
function, on return, this field specifies data that has been sent by the peer accepting the connection.- In the
call
parameter to theOTAccept
function, you can use this field to specify data you want to send back to the peer that requested the connection.- In the
call
parameter to theOTSndDisconnect
function, this field specifies the location and size of any data associated with the disconnection request.sequence
- A long that is used by the
OTListen
andOTAccept
functions to specify the connection ID.- In the
call
parameter to theOTListen
function, on return, this field contains the connection ID of the incoming request.- In the
call
parameter to theOTAccept
function, you must use this field to specify the connection ID of the connection request that you are accepting. This must be the same value that was passed to you by theOTListen
function when you received the connection request.- In the
call
parameter to theOTSndDisconnect
function, this field specifies the same connection ID as was returned by theOTListen
function when the connection request was received. You must specify a value if you are calling theOTSndDisconnect
function to reject a connection request. This field is only meaningful if the endpoint is in theT_INCON
state.